#pragma once
#include "ALBaseSaliency.h"

class CALSITTI : public CALBaseSaliency
{
public:
	CALSITTI();
	CALSITTI(CALStepItem* pStepItem);
	~CALSITTI();

public:
	//https://github.com/abin24/Saliency-detection-toolbox

	virtual void test();
	virtual void convert();
	virtual void convert(const Mat &src, Mat &dst);

	void calculateSaliencyMap(const Mat*  src, Mat * dst, int corlor = 1, int scaleBase = 3);
	void viewFeaturemaps();
	void combineFeatureMaps(int corlor, int scale);

	Mat conspicuityMap_I;
	Mat conspicuityMap_C;
	Mat conspicuityMap_O;
	Mat S;

private:
	Mat r, g, b, R, G, B, Y, I;
	vector<Mat> gaussianPyramid_I;
	vector<Mat> gaussianPyramid_R;
	vector<Mat> gaussianPyramid_G;
	vector<Mat> gaussianPyramid_B;
	vector<Mat> gaussianPyramid_Y;

	void createChannels(const Mat* src);
	void createScaleSpace(const Mat* src, vector<Mat>* dst, int scale);

	void normalize_rgb();
	void create_RGBY();
	void createIntensityFeatureMaps();
	void createColorFeatureMaps();
	void createOrientationFeatureMaps(int orientation);
	void mapNormalization(Mat* src);
	void clearBuffers();

	vector<Mat> featureMaps_I;
	vector<Mat> featureMaps_RG;
	vector<Mat> featureMaps_BY;
	vector<Mat> featureMaps_0;
	vector<Mat> featureMaps_45;
	vector<Mat> featureMaps_90;
	vector<Mat> featureMaps_135;
};

